<?php

use Illuminate\Database\Migrations\Migration;

class SetupVoteTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create("vote_subjects", function ($table) {
            $table->increments('rid')->unsigned();
            $table->bigInteger("views");
            $table->bigInteger("likes");
            $table->string('id');
            $table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
            $table->bigInteger("total");
            $table->string('user_id');
            $table->longText('title');
            $table->string('sense_id');
            $table->string('my_choice');
            $table->longText('choices');
            $table->timestamp('updated_at');
            /**
             * Add Foreign/Unique/Index
             */
            $table->unique('id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        /**
         * Drop tables
         */
        Schema::drop("vote_subjects");
    }
}
